package com.lyl.web;

import com.lyl.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * @author lyl
 */
@Controller
public class HelloController
{
	@Autowired
	private BookService bookService;

	@RequestMapping({"/", "/home"})
	public String index()
		{
			return "index";
		}

	@RequestMapping("/admin")
	public String hello()
		{
			return "admin";
		}

	@RequestMapping("/service")
	public String service()
		{
			bookService.service();
			return "service";
		}

	@RequestMapping(value = "/login", method = RequestMethod.GET)
	public String login()
		{
			return "login";
		}

	@RequestMapping(value = "/error", method = RequestMethod.GET)
	public String error()
		{
			return "error";
		}

}